from openai import OpenAI
from openai.lib.azure import API_KEY_SENTINEL

from constant import DEEPSEEK_API_KEY

# 初始化客户端
client = OpenAI(
    api_key=DEEPSEEK_API_KEY,  # 替换为你的 DeepSeek API Key
    base_url="https://api.deepseek.com"  # DeepSeek 的 API 地址
)

# 调用 R1 模型
# response = client.chat.completions.create(
#     model="deepseek-r1",  # 指定模型名称
#     messages=[
#         {"role": "user", "content": "写一首关于春天的诗"}
#     ],
#     temperature=0.7,  # 控制随机性（0-1，越高越随机）
#     max_tokens=200    # 限制生成文本长度
# )
models = client.models.list()
for model in models.data:
    print(model)
    print(model.id)
# 输出结果
# print(response.choices[0].message.content)
